#include<iostream>
#include<cmath>
#include<algorithm>
using namespace std;
typedef long long LL;
int gcd(int a, int b)
{
	return b ? a % b : a;
}
int main()
{
	int a, b;
	cin >> a >> b;
	if (a > b) {
		swap(a, b);
	}
	int x = gcd(a, b);
	int y = a * b / x;
	cout << x << endl;
	cout << y << endl;
	return 0;
}